$j=jQuery.noConflict();
$j(document).ready(function()
{
	$j("#mallsSearchInput").keyup(function(event)
	{
		var val=$j(this).val();
		$j.ajax(
		{
			url:"actions/mallsSearchSuggest.php",
      		data:"city="+$j("#cityHidden").val()+"&val="+val+"&id="+$j("#mallsId").val(),
     	 	success:function(result)
     	 	{
     	 		$j("#mallsSearchSuggest").css("display", "block");
     	 		$j("#mallsSearchSuggest").html(result);
		     	$j(".mallsSearchRes").mouseover(function(event)
		     	{
		     		$j(this).css("background-color", "#8EE5EE");
		 		});
		 		$j(".mallsSearchRes").mouseout(function(event)
		     	{
		     		$j(this).css("background-color", "white");
		 		});
		 		$j(".mallsSearchRes").one("click", function(event)
		 		{
		 			$j("#mallsSearchInput").val($j(this).html());
		 			$j("#mallsSearchSuggest").slideUp(300);
		 			$j("#mallsSearchSuggest").html("");
		 			$j("#mallsSearchForm").submit();
				});
     		}
     	});
	});
});